<?php
/**
 * This file is part of php-agenda.
 * 
 * php-agenda is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * php-agenda is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with php-agenda; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Copyright 2006, Thomas Abeel
 * 
 * Project: http://sourceforge.net/projects/php-agenda/
 * 
 */
?>
<?php
/*
 * Load languages
 */
 session_start();
include ('includes/php_language_detection.inc.php');
include ('lang/default.inc.php');
$langX = getLanguages();
foreach ($langX as $langY) {
	$filename = 'lang/' . $langY[0] . '.inc.php';
	if (file_exists($filename))
		include ($filename);
}
/*
 * Rest of the includes
 */
include ('adodb/adodb.inc.php');
include ('local_config_inc.php');
$db = ADONewConnection('mysql');
$db->Connect($dbhost, $dbuser, $dbpass, $dbname);
$db->debug = false;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
  <title>The Simple PHP Agenda</title>
  <link href="style.css.php" rel="stylesheet" type="text/css"/>
</head>
<body>
<div align="center" id="loginbox">
<form action="index.php" method="post">
<p><label for="user"><?php echo $lang["login-user"];?>: </label>
<?php
	if (isset ($_SESSION["user"])) {
		echo '<input type="text" name="user" width=50 value="' . $_SESSION["user"] . '"/>';
	} else {
		echo '<input type="text" name="user" width=50 />';
	}
?>
</p>
<p><label for="pass" ><?php echo $lang["login-pass"];?>: </label>
<input type="password" name="pass" width=50/></p>

<p><input id="loginsubmit" type="submit" name="logIn" value="Log in"/></p>
</form>
</div>
<?php $db->Close();?>
</body>
</html>
